package chapter12Lock.solution;


/**
 * 消费者
 * Created by LinGer on 2019/6/19
 */
public class Consumer {

    private DepotWithCondition depot;

    public Consumer(DepotWithCondition depot){
        this.depot = depot;
    }

    /**
     * 新建一个线程从仓库中消费产品
     * @param val
     */
    public void consumer(final int val){
        new Thread(() -> depot.consume(val)).start();
    }
}
